#include "trap.h"
#include "basic_test.h"
    .set noat
    .globl main
    .data 
    data1: .byte 0xee, 0x11, 0xee, 0xee
    .text
main:
    # 0x3 eeee11ee 0x0
    LB_TEST(data1, 0x0000) # 0xffffffee
    LB_TEST(data1, 0x0001) # 0x00000011
    LBU_TEST(data1, 0x0000) # 0x000000ee
    LBU_TEST(data1, 0x0001) # 0x00000011

    SB(0xccbb, 0xddaa, data1, 0x0000) # [0x0] = 0xaa
    SB(0x4444, 0x4444, data1, 0x0004) # [0x4] = 0x44
    SB(0x77ff, 0xffbb, data1, 0x000b) # [0xb] = 0xbb
    nop
    nop
    nop
    # eeee11aa 00000044 bb000000
    LB_TEST(data1, 0x0000) # 0xffffffaa
    LB_TEST(data1, 0x0004) # 0x00000044
    LBU_TEST(data1, 0x000b) # 0x000000bb
    nop
    nop
    nop
    SH(0x3333, 0x2334, data1, 0x0006) # [0x6] = 0x34 [0x7] = 0x23
    SH(0xeeff, 0xbbcc, data1, 0x0002) # [0x2] = 0xcc [0x3] = 0xbb
    SH(0x5678, 0x4567, data1, 0x0008) # [0x8] = 0x67 [0x9] = 0x45
    # bbcc11aa 23340044 bb004567
    nop
    nop
    nop
    LH_TEST(data1, 0x0000) # 0x000011aa
    LH_TEST(data1, 0x0004) # 0x00000044
    LH_TEST(data1, 0x0002) # 0xffffbbcc
    
    LHU_TEST(data1, 0x0008) # 0x00004567
    LHU_TEST(data1, 0x000a) # 0x0000bb00
    LHU_TEST(data1, 0x0002) # 0x0000bbcc
    nop
    nop
    nop
    SW(0x5678, 0xabcd, data1, 0x0000) # [0x4-0x7] = 0xcdab7856
    SW(0x8000, 0x0000, data1, 0x0008) # [0x8-0xc] = 0x00000080
    # 5678abcd 23340044 80000000
    nop
    nop
    nop
    LW_TEST(data1, 0x0000) # 0x5678abcd
    LW_TEST(data1, 0x0008) # 0x80000000
    nop
    nop
    nop
    SB(0x7fff, 0xffff, data1, 0x0001) # [0x1] = 0xff 
    SH(0x6666, 0x6677, data1, 0x0002) # [0x2] = 0x77 [0x3] = 0x66
    SW(0xffff, 0xffff, data1, 0x0008) # [0xc-0xf] = ffffffff
    # 6677ffcd 23340044 ffffffff
    nop
    nop
    nop
    LW_TEST(data1, 0x0000) # 0x6677ffcd
    LH_TEST(data1, 0x000a) # 0xffffffff
    LHU_TEST(data1, 0x000a) # 0x0000ffff
    LB_TEST(data1, 0x0000) # 0xffffffcd
    LBU_TEST(data1, 0x0000) # 0x000000cd
    
    HIT_GOOD_TRAP		# stop temu